import nodeOS from "os";
import path from "path";
export class SysFolder {
    private static instance: SysFolder | undefined;
    private constructor() {
    }

    public get homeDir(): string {
        return nodeOS.homedir();
    }

    public static getInstance(): SysFolder {
        if (!SysFolder.instance) {
            SysFolder.instance = new SysFolder();
        }
        return SysFolder.instance;
    }

    public get chromeExtensions(): string {
        if (nodeOS.platform() === "win32") {
            return path.join(this.homeDir, "AppData\\Local\\Google\\Chrome\\User Data\\Default\\Extensions");
        }
        return path.join(this.homeDir, "./Library/Application Support/Google/Chrome/Default/Extensions");
    }
}

export const sysFolder = SysFolder.getInstance();
